package com.lucker.ds.model;

import java.util.Date;

/**
 * eveny_day_open_time
 * @author 
 */
public class EvenyDayOpenTime extends BaseValueObject {
    private Long id;

    /**
     * 期号
     */
    private String issueno;

    /**
     * 开奖时间
     */
    private Date openDate;

    /**
     * 彩票ID
     */
    private Long caiId;

    /**
     * 期号前缀
     */
    private String issuenoPrefix;

    private String extend1;

    private String extend2;

    private String customQuerySqlText = null;

    private String orderStr = null;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getIssueno() {
        return issueno;
    }

    public void setIssueno(String issueno) {
        this.issueno = issueno;
    }

    public Date getOpenDate() {
        return openDate;
    }

    public void setOpenDate(Date openDate) {
        this.openDate = openDate;
    }

    public Long getCaiId() {
        return caiId;
    }

    public void setCaiId(Long caiId) {
        this.caiId = caiId;
    }

    public String getIssuenoPrefix() {
        return issuenoPrefix;
    }

    public void setIssuenoPrefix(String issuenoPrefix) {
        this.issuenoPrefix = issuenoPrefix;
    }

    public String getExtend1() {
        return extend1;
    }

    public void setExtend1(String extend1) {
        this.extend1 = extend1;
    }

    public String getExtend2() {
        return extend2;
    }

    public void setExtend2(String extend2) {
        this.extend2 = extend2;
    }

    public void setCustomQuerySqlText(String customQuerySqlText) {
        this.customQuerySqlText = customQuerySqlText;
    }

    public String getCustomQuerySqlText() {
        return customQuerySqlText;
    }

    public void orderById(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by id asc";
            }else{
                this.orderStr = this.orderStr + ",id asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by id desc";
            }else{
                this.orderStr = this.orderStr + ",id desc";
            }
        }
    }

    public void orderByIssueno(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by issueno asc";
            }else{
                this.orderStr = this.orderStr + ",issueno asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by issueno desc";
            }else{
                this.orderStr = this.orderStr + ",issueno desc";
            }
        }
    }

    public void orderByOpenDate(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by open_date asc";
            }else{
                this.orderStr = this.orderStr + ",open_date asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by open_date desc";
            }else{
                this.orderStr = this.orderStr + ",open_date desc";
            }
        }
    }

    public void orderByCaiId(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by cai_id asc";
            }else{
                this.orderStr = this.orderStr + ",cai_id asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by cai_id desc";
            }else{
                this.orderStr = this.orderStr + ",cai_id desc";
            }
        }
    }

    public void orderByIssuenoPrefix(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by issueno_prefix asc";
            }else{
                this.orderStr = this.orderStr + ",issueno_prefix asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by issueno_prefix desc";
            }else{
                this.orderStr = this.orderStr + ",issueno_prefix desc";
            }
        }
    }

    public void orderByExtend1(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by extend1 asc";
            }else{
                this.orderStr = this.orderStr + ",extend1 asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by extend1 desc";
            }else{
                this.orderStr = this.orderStr + ",extend1 desc";
            }
        }
    }

    public void orderByExtend2(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by extend2 asc";
            }else{
                this.orderStr = this.orderStr + ",extend2 asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by extend2 desc";
            }else{
                this.orderStr = this.orderStr + ",extend2 desc";
            }
        }
    }
}